import { fliterPermission } from '@/utils/sys.js'

export const apis = {
  list: `/business/country/getList?modelCode=MODEL_COUNTRY&authCode=FUNCTION_COUNTRY_LIST`,
  del: `business/country/del?authCode=BTN_COUNTRY_DEL`,
  add: `business/country/add?authCode=BTN_COUNTRY_ADD`,
  edit: `business/country/edit?authCode=BTN_COUNTRY_EDIT`,
  detail: `business/basis/detail?modelCode=MODEL_COUNTRY&authCode=BTN_COUNTRY_DETAIL`,
  auth: `business/country/auth?modelCode=MODEL_COUNTRY&authCode=BTN_COUNTRY_AUTH`,
};
export const configs = {
  listUrl: apis.list,
  pageOn: true, // 开启分页
  searchOn: true, // 开启搜索
  operateOn: true, //开启操作区域
  treeOn: false, // 开启树形
  searchMode:'custome',
};

export const searchs = [
  {
    type: "Input",
    column: "country_code",
    label: "地区编码",
  },
  {
    type: "Input",
    column: "country_name",
    label: "地区名称",

  }
];

export const pages = {
  pageSize: 20,
  orders: [
    {
      field: "id",
      sort: "desc",
    },
  ],
};
export const columns = [
  { type: "selection" },
 
  {
    label: "地区编码",
    column: "country_code",
    sortable: "custom",
    display: "text",
  },
  {
    label: "地区名称",
    column: "country_name",

  },
  {
    label: "币种编码",
    column: "currency_code",
  },
  {
    label: "币种",
    column: "currency_code",
    format:'model',
   
  },
  {
    label: "创建时间",
    column: "ctime",


    
  },
  {
    label: "更新时间",
    column: "utime",


    
  },
  {
    label: "操作",
    column: "operate",
    width: "220",
    fixed: "right",
  }
];

export const buttons = fliterPermission([
  {
    operate: "add",
    text: "新增",
    permission: 'BTN_COUNTRY_ADD',
 
  },
  // {
  //   operate: "deleteAll",
  //   text: "删除",
  //   permission: 'BTN_COUNTRY_DEL',
  //   type:'danger'
  // },
  
])
export const columnButtons = fliterPermission([
  {
    operate: "detail",
    text: "详情",
    permission: 'BTN_COUNTRY_DETAIL',
  },
  {
    operate: "edit",
    text: "编辑",
    permission: 'BTN_COUNTRY_EDIT',

  },
   {
    operate: "auth",
    text: "绑定币种",
    permission: 'BTN_COUNTRY_AUTH',

  },
  {
    operate: "delete",
    text: "删除",
    permission: 'BTN_COUNTRY_DEL',
    type:'danger'
  }
])
